package com.laiyizhan.common.mapper;

import com.laiyizhan.common.model.Fourth_message;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface Fourth_messageMapper {
    @Delete({
        "delete from fourth_message",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into fourth_message (city, county, ",
        "country, hospital, ",
        "type, nature)",
        "values (#{city,jdbcType=VARCHAR}, #{county,jdbcType=VARCHAR}, ",
        "#{country,jdbcType=VARCHAR}, #{hospital,jdbcType=VARCHAR}, ",
        "#{type,jdbcType=VARCHAR}, #{nature,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(Fourth_message record);

    int insertSelective(Fourth_message record);

    @Select({
        "select",
        "id, city, county, country, hospital, type, nature",
        "from fourth_message",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    Fourth_message selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Fourth_message record);

    @Update({
        "update fourth_message",
        "set city = #{city,jdbcType=VARCHAR},",
          "county = #{county,jdbcType=VARCHAR},",
          "country = #{country,jdbcType=VARCHAR},",
          "hospital = #{hospital,jdbcType=VARCHAR},",
          "type = #{type,jdbcType=VARCHAR},",
          "nature = #{nature,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Fourth_message record);
}